using System;
using System.Collections.Generic;
using System.Text;
using BodySoundSimulator.CaseData;
using System.IO;
using System.Reflection;

namespace BodySoundSimulator.CommonElements
{
    class SimulatorFileManager
    {
        public static readonly string CasesFolderName = "Cases";

        public static string GetSoundFileName(string caseID,
            AuscultationSiteInfo selectedSite,
            AuscultationConfiguration configuration)
        {
            return string.Format("case_{0}_{1}_{2}_{3}.wav",
                caseID, 
                selectedSite.Location.X,
                selectedSite.Location.Y,
                configuration.ToString());
        }

        public static string GetMapFileName(string caseID)
        {
            return string.Format("case_{0}.xml", caseID);
        }

        public static string GetCaseTempFolderName(string caseID)
        {
            return string.Format("case_{0}", caseID);
        }

        public static string GetInfoString(string fileName)
        {
            Assembly executingAssembly = Assembly.GetExecutingAssembly();
            TextReader reader = new StreamReader(executingAssembly.GetManifestResourceStream(string.Format("BodySoundSimulator.Recording.{0}", fileName)));
            string content = reader.ReadToEnd();
            return content;
        }
    }
}
